{% extends 'base.html' %}
{% load static %}

{% block content %}
<h1 class="mb-4">电影列表</h1>
<div class="row row-cols-1 row-cols-md-3 g-4">
    {% for movie in movies %}
    <div class="col">
        <div class="card h-100">
            <!-- 使用 static 标签加载图片 -->
            <img src="{% static 'default_poster.jpg' %}" class="card-img-top" alt="{{ movie.title }}">
            <div class="card-body">
                <h5 class="card-title">{{ movie.title }}</h5>
                <p class="card-text">类型: {{ movie.genre }}</p>
                <p class="card-text">时长: {{ movie.duration }} 分钟</p>
                <a href="{% url 'schedule_list' movie.id %}" class="btn btn-primary">查看场次</a>
            </div>
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}
</html>